/*************************************************
Author: tony
Date: 1/25/2013
Description:
Notes: 
*************************************************/

#ifndef __cmdcrystal_h__
#define __cmdcrystal_h__

#include "../maindef.h"
#include "commclass.h"
#include "PBMsgHead.pb.h"
#include "MsgCrystal.pb.h"

class CMainCtrl;
class CDropItem;
class CCmdMineCrystal : public CTAsyncCmd
{
public:
    virtual int Do(void* pData);
    virtual int AnsClients(int iRet);
    virtual int LogicDo(int iRet);

    CMainCtrl* pstMainCtrl;
    PBMsgHead  stMsgHead;
    CEnpNetHead stEnpHead;

    unsigned int uiGID;
    MsgReqMineCrystal stReq;
    MsgAnsMineCrystal stAns;
    bool bNeedSaveBaseInfo;
    bool bNeedSaveDetailInfo;
private:
    CDropItem _astAnsMineRet;
    int _iTodayMaxDeepMineCount;
    int _iMineRet;

    void GetMineCrystalInfo(unsigned char ucMineType, int iMineCount, MsgMineCrystalInfo & stMineInfo);
    bool ReNewMineCount (CPlayerBaseInfo & stPlayerBaseInfo, CPlayerDetailInfo& stPlayerDetailInfo);
    int  GetDeepMineCountPerDay (CPlayerBaseInfo & stPlayerBaseInfo);
    int LowMineCrystal(CPlayerBaseInfo & stPlayerBaseInfo, CPlayerDetailInfo & stPlayerDetailInfo, CPlayerOnlineData & stPlayerOnlineData, int iCount, int & iRealMineCount);
    int DeepMineCrystal(CPlayerBaseInfo & stPlayerBaseInfo, CPlayerDetailInfo & stPlayerDetailInfo,
                    CPlayerOnlineData & stPlayerOnlineData, int iCount, int & iRealMineCount);
}; 



#endif // __cmdcrystal_h__

